/*
 * @Author: lsmi
 * @Date: 2021-09-05 10:25:49
 * @LastEditors: lsmi
 * @LastEditTime: 2021-09-12 11:23:23
 * @FilePath: \v2_play_js\src\components\message\main.js
 */
import Vue from "vue";
import main from "./index.vue";

let MessageConstructor = Vue.extend(main);
let instance;
const Message = (message) => {
  instance = new MessageConstructor({
    data: {
      message,
    },
  });
  instance.$mount();
  document.body.appendChild(instance.$el);
  return instance;
};
Message.close = () => {
  instance.show = false;
};
Message.show = () => {
  console.log(instance, "instance");
  instance.show = true;
};

export default Message;
